/*
 * @Author: wang cong wangc9832@163.com
 * @Date: 2023-07-11 17:18:35
 * @LastEditors: wang cong wangc9832@163.com
 * @LastEditTime: 2023-11-03 10:50:03
 * @FilePath: /ams_product_front/src/components/Form/src/componentMap.ts
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */
import type { Component } from 'vue';
import type { ComponentType } from './types/index';

/**
 * Component list, register here to setting it in the form
 */
import {
  Input,
  Select,
  Radio,
  Checkbox,
  AutoComplete,
  Cascader,
  DatePicker,
  InputNumber,
  Switch,
  TimePicker,
  TreeSelect,
  Slider,
  Rate,
  Divider,
  Upload
} from 'ant-design-vue';

import ApiRadioGroup from './components/ApiRadioGroup.vue';
import ApiCheckboxGroup from './components/ApiCheckboxGroup.vue';
import ApiSelect from './components/ApiSelect.vue';
import ApiTree from './components/ApiTree.vue';
import ApiTreeSelect from './components/ApiTreeSelect.vue';
import ApiCascader from './components/ApiCascader.vue';
import ApiTransfer from './components/ApiTransfer.vue';
import AvUpload from './components/AvUpload.vue';
import AreaSelect from './components/AreaSelect.vue';
// import { BasicUpload } from '@/components/Upload';
import { StrengthMeter } from '@/components/StrengthMeter';
import { IconPicker } from '@/components/Icon';
import { CountdownInput } from '@/components/CountDown';
// import CodeMirror from '@/components/CodeMirror/index.vue';
import EasyUpload from './components/Upload.vue';
import { Tinymce } from '@/components/Tinymce';
import ViewField from './components/ViewField.vue';
import RadioButtonGroup from './components/RadioButtonGroup.vue';
import NumberBetween from './components/NumberBetween.vue';
import CollapseContainer from '@/components/Container/src/collapse/CollapseContainer.vue';
import MonacoEditor from '@/components/Monaco/src/index.vue';
// 业务组件
import MapPicker from './busComponents/MapPicker.vue';
import MapBlockPicker from './busComponents/MapBlockPicker.vue';
import RoleOrgSelect from './busComponents/RoleOrgSelect.vue';
import OrgRoleSelect from './busComponents/OrgRoleSelect.vue';
import InsertInput from './busComponents/InsertInput.vue';
// import ApiSelectTable from './components/ApiSelectTable.vue';
const componentMap = new Map<ComponentType, Component>();

componentMap.set('Input', Input);
componentMap.set('InputGroup', Input.Group);
componentMap.set('InputPassword', Input.Password);
componentMap.set('InputSearch', Input.Search);
componentMap.set('InputTextArea', Input.TextArea);
componentMap.set('InputNumber', InputNumber);
componentMap.set('AutoComplete', AutoComplete);

componentMap.set('Select', Select);
componentMap.set('ApiSelect', ApiSelect);
componentMap.set('ApiTree', ApiTree);
componentMap.set('TreeSelect', TreeSelect);
componentMap.set('ApiTreeSelect', ApiTreeSelect);
componentMap.set('ApiRadioGroup', ApiRadioGroup);
componentMap.set('RadioButtonGroup', RadioButtonGroup);
componentMap.set('Switch', Switch);
componentMap.set('RadioGroup', Radio.Group);
componentMap.set('Checkbox', Checkbox);
componentMap.set('CheckboxGroup', Checkbox.Group);
componentMap.set('ApiCheckboxGroup', ApiCheckboxGroup);
componentMap.set('ApiCascader', ApiCascader);
componentMap.set('Cascader', Cascader);
componentMap.set('Slider', Slider);
componentMap.set('Rate', Rate);
componentMap.set('ApiTransfer', ApiTransfer);
componentMap.set('AreaSelect', AreaSelect);
componentMap.set('DatePicker', DatePicker);
componentMap.set('MonthPicker', DatePicker.MonthPicker);
componentMap.set('RangePicker', DatePicker.RangePicker);
componentMap.set('WeekPicker', DatePicker.WeekPicker);
componentMap.set('TimePicker', TimePicker);
componentMap.set('StrengthMeter', StrengthMeter);
componentMap.set('IconPicker', IconPicker);
componentMap.set('InputCountDown', CountdownInput);

componentMap.set('Upload', Upload);
componentMap.set('AvUpload', AvUpload);
componentMap.set('Divider', Divider);
// componentMap.set('CodeMirror', CodeMirror);
componentMap.set('AMapPicker', MapPicker);
componentMap.set('AMapBlockPicker', MapBlockPicker);
componentMap.set('RichText', Tinymce);
componentMap.set('ViewField', ViewField);
componentMap.set('NumberBetween', NumberBetween);
componentMap.set('CollapseContainer', CollapseContainer);
componentMap.set('MonacoEditor', MonacoEditor);
componentMap.set('RoleOrgSelect', RoleOrgSelect);
componentMap.set('OrgRoleSelect', OrgRoleSelect);
componentMap.set('InsertInput', InsertInput);

export function add(compName: ComponentType, component: Component) {
  componentMap.set(compName, component);
}

export function del(compName: ComponentType) {
  componentMap.delete(compName);
}

export { componentMap };
